<template>
  <div class="department-form-container">
    <!-- 返回按钮 -->
    <div class="back-button" @click="goBack">
      <i class="el-icon-arrow-left"></i>
    </div>

    <h2 class="form-title">添加新部门</h2>

    <el-form ref="departmentForm" :model="department" label-width="100px" :rules="rules">
      <el-form-item label="部门编号" prop="code">
        <el-input v-model="department.code" placeholder="请输入部门编号"></el-input>
      </el-form-item>
      <el-form-item label="部门名称" prop="name">
        <el-input v-model="department.name" placeholder="请输入部门名称"></el-input>
      </el-form-item>
      <el-form-item label="部门职能" prop="remarks">
        <el-input v-model="department.remarks" placeholder="请输入部门职能"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">立即创建</el-button>
        <el-button @click="resetForm">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script src="../../script/department/AddDepartment.js"></script>
<style scoped src="../../assets/style/AddDepartment.css"></style>